#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

   // ui->tableWidget->name = QString("project1");
    ui->tableWidget->setRowCount(2);
    ui->tableWidget->setColumnCount(2);

    QTableWidgetItem*  item =  new QTableWidgetItem("1");
    item->setTextAlignment(Qt::AlignCenter);

    ui->tableWidget->setItem(0,0,item);
    item =  new QTableWidgetItem("MI");


    ui->tableWidget->setItem(0,1,item);
    item =  new QTableWidgetItem("2");

    ui->tableWidget->setItem(1,0,item);
    item =  new QTableWidgetItem("HUA");

    ui->tableWidget->setItem(1,1,item);

    ui->tableWidget_2->name = QString("project2");
    ui->tableWidget_2->setRowCount(2);
    ui->tableWidget_2->setColumnCount(2);

    item =  new QTableWidgetItem("1");


    ui->tableWidget_2->setItem(0,0,item);
    item =  new QTableWidgetItem("1");

    ui->tableWidget_2->setItem(0,1,item);
    item =  new QTableWidgetItem("2");

    ui->tableWidget_2->setItem(1,0,item);
    item =  new QTableWidgetItem("2");


    //ui->tableWidget_2->setItem(1,1,item);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::moveCurrentItem(MTableWidget *source,
                                    MTableWidget *target)
{
//    if (source->currentItem()) {
//        MTableWidget *newItem = source->currentItem()->clone();
//        target->addItem(newItem);
//        target->setCurrentItem(newItem);
//        delete source->currentItem();
//    }
}
